package com.ansion.basedb.dao;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;


import com.ansion.basedb.dao.entity.DemoEntity;

import java.util.List;

@Dao
public interface DemoDao {
    @Query("SELECT * FROM DemoEntity")
    List<DemoEntity> getAll();


    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void save(DemoEntity entity);


    @Query("SELECT * FROM DemoEntity WHERE groupId = :idValue")
    DemoEntity getById(String idValue);

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void save(List<DemoEntity> list);

    @Delete
    void delete(List<DemoEntity> entityList);
}
